              package com.java.diagnostics.visualizer.impl.data;
              
              import com.java.diagnostics.visualizer.data.UnstructuredDataBuilder;
              import com.java.diagnostics.visualizer.data.ids.ID;
              import com.java.diagnostics.visualizer.impl.data.ids.UnstructuredIDImpl;
              import java.util.ArrayList;
              import java.util.Iterator;
              import java.util.List;
              
              public class UnstructuredDataImpl extends DomainDataImpl
                implements UnstructuredDataBuilder
              {
                private static final String[] STRING_ARRAY = new String[0];
                private static final String NEWLINE = System.getProperty("line.separator");
                private String value;
                private List problems;
                private List warnings;
                private List comments;
                private List goodthings;
              
                public UnstructuredDataImpl(String label, String displayName, String category)
                {
                  super(label, displayName, category);
                  this.problems = new ArrayList();
                  this.warnings = new ArrayList();
                  this.comments = new ArrayList();
                  this.goodthings = new ArrayList();
                }
              
                public UnstructuredDataImpl(String label, String displayName, String category, String value) {
                  this(label, displayName, category);
                  addComment(value);
                }
              
                public void addComment(String comment) {
                  this.value = null;
                  if ((comment != null) && (comment.length() > 0))
                  {
                    this.comments.add(comment);
                  }
                }
              
                public void addGoodThing(String comment)
                {
                  this.value = null;
                  if ((comment != null) && (comment.length() > 0))
                  {
                    this.goodthings.add(comment);
                  }
                }
              
                public void addProblem(String problem) {
                  this.value = null;
                  if ((problem != null) && (problem.length() > 0))
                  {
                    this.problems.add(problem);
                  }
                }
              
                public void addWarning(String warning) {
                  if ((warning != null) && (warning.length() > 0))
                  {
                    this.value = null;
                    this.warnings.add(warning);
                  }
                }
              
                public String[] getComments()
                {
                  return (String[])this.comments.toArray(STRING_ARRAY);
                }
              
                public String[] getGoodThings() {
                  return (String[])this.goodthings.toArray(STRING_ARRAY);
                }
              
                public String[] getProblems() {
                  return (String[])this.problems.toArray(STRING_ARRAY);
                }
              
                public String[] getWarnings() {
                  return (String[])this.warnings.toArray(STRING_ARRAY);
                }
              
                public String getValue() {
                  if (this.value == null)
                  {
                    StringBuffer buffer = new StringBuffer();
                    Iterator it = this.problems.iterator();
                    appendContents(buffer, it);
                    it = this.warnings.iterator();
                    appendContents(buffer, it);
                    it = this.goodthings.iterator();
                    appendContents(buffer, it);
                    it = this.comments.iterator();
                    appendContents(buffer, it);
                    this.value = buffer.toString();
                  }
                  return this.value;
                }
              
                private void appendContents(StringBuffer buffer, Iterator it) {
                  while (it.hasNext())
                  {
                    buffer.append(it.next());
                    buffer.append(NEWLINE);
                  }
                }
              
                protected ID generateID() {
                  return new UnstructuredIDImpl(getCategory(), this.label);
                }
              
                public boolean isEmpty()
                {
                  return (this.problems.size() == 0) && (this.warnings.size() == 0) && (this.comments.size() == 0) && (this.goodthings.size() == 0);
                }
              }

